//
//  wefwe_InputView.m
//  kratos_framework_Example
//
//  Created by 7yao.top on 2018/10/24.
//  Copyright © 2018年 kratos_framework. All rights reserved.
//

#import "Kratos_InputView.h"
#import "k_const.h"
#import "Kratos_MainViewControllerPresenter.h"

@interface Kratos_InputView()
@property (nonatomic,strong) Kratos_MainViewControllerPresenter *Kra_persenter;
@property (nonatomic,copy) NSString *Kra_phoneNumber;
@end


@implementation Kratos_InputView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if ( self) {
        
        [self Kratos_configrationUI];
    }
    return self;
}

- (Kratos_inputCode *)Kra_codeinput11
{
    if (_Kra_codeinput11 == nil)
    {
        __weak typeof(self) weakSelf = self;
        _Kra_codeinput11 = [[Kratos_inputCode alloc] initWithcodeNumChangeBlock:^(NSString *phone) {
            
        } Kratos_countDownBlock:nil Kratos_countDownStrat:^(Kratos_CountDownButton *countDownCode) {
            [weakSelf.Kra_persenter Kratos_getmsgCode:weakSelf.Kra_phoneNumber];

        } Kratos_countDownend:^(Kratos_CountDownButton *countDownCode) {
            
        }];
    }
    return _Kra_codeinput11;
}




- (Kratos_phoneinput *)Kra_phoneInput
{
    if (_Kra_phoneInput == nil)
    {
        __weak typeof(self) weakSelf = self;
        _Kra_phoneInput = [[Kratos_phoneinput alloc]initWithphoneNumChangeBlock:^(NSString *str) {
            weakSelf.Kra_phoneNumber = str;
        }];
        _Kra_phoneInput.Kra_textField.keyboardType = UIKeyboardTypePhonePad;
        _Kra_phoneInput.Kra_textField.placeholder = @"请输入手机号码";

    }
    return _Kra_phoneInput;
}


- (Kratos_MainViewControllerPresenter *)Kra_persenter
{
    if (_Kra_persenter == nil) {
        _Kra_persenter = [[Kratos_MainViewControllerPresenter alloc] initWithView:self];
    }
    return _Kra_persenter;
}


- (void)Kratos_configrationUI
{
    
    
    [self addSubview:self.Kra_phoneInput];
    [self addSubview:self.Kra_codeinput11];

    [self.Kra_phoneInput mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(10);
        make.top.equalTo(self.mas_top).offset(10);
        make.right.equalTo(self.mas_right).offset(-10);
        make.height.mas_equalTo(inputH);
        
    }];
    
    
    
    [self.Kra_codeinput11 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(10);
        make.top.equalTo(self.Kra_phoneInput.mas_bottom).offset(10);
        make.right.equalTo(self.mas_right).offset(-10);
        make.bottom.equalTo(self.mas_bottom).offset(-10);
        make.height.mas_equalTo(inputH);
    }];
    

}



@end
